Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Scope class for filtering/where impl. for Model #660

Merged
merged 57 commits into from
Jul 23, 2020

Conversation

georgehristov
Copy link
Collaborator

Basic features of #551

Related to #524

docs/conditions.rst Outdated Show resolved Hide resolved
tests/ConditionTest.php Outdated Show resolved Hide resolved
src/Model/Scope.php Outdated Show resolved Hide resolved
src/Model.php Outdated Show resolved Hide resolved
src/Model.php Outdated Show resolved Hide resolved
src/Model.php Outdated Show resolved Hide resolved
src/Action/Iterator.php Outdated Show resolved Hide resolved
src/Action/Iterator.php Outdated Show resolved Hide resolved
src/Model/Scope/BasicCondition.php Outdated Show resolved Hide resolved
src/Model/Scope/BasicCondition.php Show resolved Hide resolved
src/Model/Scope/CompoundCondition.php Show resolved Hide resolved
@@ -178,14 +178,14 @@ public function toWords(Model $model = null): string
*/
public static function createAnd(...$conditions)
{
return new self($conditions, self::AND);
return new static($conditions, self::AND);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self is intentional as using Model\Scope::createAnd brings unexpected results

@georgehristov georgehristov merged commit 518b027 into develop Jul 23, 2020
@georgehristov georgehristov deleted the feature/model-scope-basic branch July 23, 2020 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants